package com.konne.nightmare.FastPublicOpinion.ui.personal.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.Switch;
import android.widget.TextView;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.konne.nightmare.FastPublicOpinion.R;
import com.konne.nightmare.FastPublicOpinion.base.BaseMvpActivity;
import com.konne.nightmare.FastPublicOpinion.base.BaseMvpPresenter;
import com.konne.nightmare.FastPublicOpinion.ui.personal.adapter.HelpAdapter;
import com.konne.nightmare.FastPublicOpinion.ui.personal.adapter.NoticeClassAdapter;
import com.konne.nightmare.FastPublicOpinion.utils.LoadProgressDialog;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * @Author: chen
 * @UpdateDate: 1/23/22
 * @UpdateRemark:
 */
public class NoticeSetActivity extends BaseMvpActivity implements View.OnClickListener{

    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.img_back)
    ImageView imgBack;
    @BindView(R.id.switch_class)
    Switch classSwitch;
    @BindView(R.id.rcl_list)
    RecyclerView rclList;
    private NoticeClassAdapter  noticeClassAdapter;
    List<String> list = new ArrayList<>();
    @Override
    protected BaseMvpPresenter createPresenter() {
        return new BaseMvpPresenter();
    }

    @Override
    public int getLayout() {
        return R.layout.activity_notice_set;
    }

    @Override
    public void initView() {
        initImmersionBar(R.color.white,true);
        tvTitle.setText("通知设置");

        list.add("作业");
        list.add("考试");
        list.add("讨论");
        list.add("公告");
        list.add("考勤");
        list.add("资料库");
        list.add("课堂互动");
        list.add("腾讯会议");
        noticeClassAdapter = new NoticeClassAdapter(R.layout.item_class_notice,list);
        rclList.setLayoutManager(new LinearLayoutManager(this));
        rclList.setAdapter(noticeClassAdapter);
        rclList.setNestedScrollingEnabled(false);
        classSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if(isChecked){
                    rclList.setVisibility(View.VISIBLE);
                }else {
                    rclList.setVisibility(View.GONE);
                }
            }
        });
    }

    @Override
    public void initData(Bundle savedInstanceState) {

    }
    @OnClick({R.id.img_back})
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.img_back:
                finish();
                break;



        }
    }
    @Override
    public LoadProgressDialog getLoadDialog() {
        return dialog;
    }

    @Override
    public void cancelLoadDialog() {
        if (dialog != null && dialog.isShowing()) {
            dialog.cancel();
        }
    }
}


